<template>
  <div>
    <el-row>
      <el-col>
        <div id="circler" :style="{width: '100%', height: '400px'}"></div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        msg: ''
      }
    },
    mounted() {
      this.drawLine();
    },
    methods: {
      drawLine() {
        // 基于准备好的dom，初始化echarts实例
        let circler = this.$echarts.init(document.getElementById('circler'));
        // 绘制图表
        circler.setOption(
/*          {
            tooltip: {
              trigger: 'item',
              formatter: "{a} <br/>{b}: {c} ({d}%)"
            },
            legend: {
              orient: 'vertical',
              x: 'left',
              data:['50%','邮件营销','联盟广告','视频广告','搜索引擎']
            },
            series: [
              {
                name:'访问来源',
                type:'pie',
                radius: ['50%', '70%'],
                avoidLabelOverlap: false,
                label: {
                  normal: {
                    show: false,
                    position: 'center'
                  },
                  emphasis: {
                    show: true,
                    textStyle: {
                      fontSize: '30',
                      fontWeight: 'bold'
                    }
                  }
                },
                labelLine: {
                  normal: {
                    show: false
                  }
                },
                data:[
                  {value:335, name:'直接访问'},
                  {value:310, name:'邮件营销'},
                  {value:234, name:'联盟广告'},
                  {value:135, name:'视频广告'},
                  {value:1548, name1:'搜索引擎',name:'50%'}
                ]
              }
            ]
          }*/
          {
            tooltip: {
              trigger: 'item'
            },
            textStyle:{
              color:'#fff',
            },
            xAxis: {
              type: 'category',
              data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
            },
            yAxis: {
              type: 'value',
              axisLabel: {
                formatter: '{value} %'
              },
            },
            series: [{
              data: [82, 93, 90, 93, 129, 133, 132, 132, 132, 132, 132, 132],
              type: 'line',
              smooth: true,
              itemStyle: {
                normal: {
                  color: "#e5c649"
                },
              },
            }]
          }
        );
      }
    }
  }
</script>

<style scoped>

</style>
